HAL LPTIM macro migration

This section provides information about the HAL LPTIM macro migration.

Note

All LPTIM macros are removed from the HAL LPTIM driver and replaced with exported functions in the LL LPTIM driver.

Related concept: Removal of hardware-related macros in HAL2

HAL LPTIM set autoreload

HAL1

HAL2

#define __HAL_LPTIM_AUTORELOAD_SET(__HANDLE__ , __VALUE__)
__STATIC_INLINE void LL_LPTIM_SetAutoReload(LPTIM_TypeDef *LPTIMx, uint32_t AutoReload)

HAL LPTIM set compare

HAL1

HAL2

#define __HAL_LPTIM_COMPARE_SET(__HANDLE__ , __CHANNEL__, __VALUE__)
__STATIC_INLINE void LL_LPTIM_OC_SetCompareCH1(LPTIM_TypeDef *lptimx, uint32_t compare_value)
__STATIC_INLINE void LL_LPTIM_OC_SetCompareCH2(LPTIM_TypeDef *lptimx, uint32_t compare_value)

HAL LPTIM enable capture compare

HAL1

HAL2

#define __HAL_LPTIM_CAPTURE_COMPARE_ENABLE(__HANDLE__, __CHANNEL__)
__STATIC_INLINE void LL_LPTIM_CC_EnableChannel(LPTIM_TypeDef *lptimx, uint32_t channel)

HAL LPTIM disable capture compare

HAL1

HAL2

#define __HAL_LPTIM_CAPTURE_COMPARE_DISABLE(__HANDLE__, __CHANNEL__)
__STATIC_INLINE void LL_LPTIM_CC_DisableChannel(LPTIM_TypeDef *lptimx, uint32_t channel)

HAL LPTIM enable

HAL1

HAL2

#define __HAL_LPTIM_ENABLE(__HANDLE__)
__STATIC_INLINE void LL_LPTIM_Enable(LPTIM_TypeDef *lptimx)

HAL LPTIM disable

HAL1

HAL2

#define __HAL_LPTIM_DISABLE(__HANDLE__)
__STATIC_INLINE void LL_LPTIM_Disable(LPTIM_TypeDef *lptimx)

HAL LPTIM enable interrupt mode

HAL1

HAL2

#define __HAL_LPTIM_ENABLE_IT(__HANDLE__, __INTERRUPT__)
__STATIC_INLINE void LL_LPTIM_EnableIT(LPTIM_TypeDef *lptimx, uint32_t it_mask)

HAL LPTIM disable interrupt mode

HAL1

HAL2

#define __HAL_LPTIM_DISABLE_IT(__HANDLE__, __INTERRUPT__)
__STATIC_INLINE void LL_LPTIM_DisableIT(LPTIM_TypeDef *lptimx, uint32_t it_mask)

HAL LPTIM enable DMA mode

HAL1

HAL2

#define __HAL_LPTIM_ENABLE_DMA(__HANDLE__, __DMA__)
__STATIC_INLINE void LL_LPTIM_EnableDMAReq(LPTIM_TypeDef *lptimx, uint32_t dma_mask)

HAL LPTIM disable DMA mode

HAL1

HAL2

#define __HAL_LPTIM_DISABLE_DMA(__HANDLE__, __DMA__)
__STATIC_INLINE void LL_LPTIM_DisableDMAReq(LPTIM_TypeDef *lptimx, uint32_t dma_mask)

HAL LPTIM clear flags

HAL1

HAL2

#define __HAL_LPTIM_CLEAR_FLAG(__HANDLE__, __FLAG__)
__STATIC_INLINE void LL_LPTIM_ClearFlag_CC1(LPTIM_TypeDef *lptimx)
__STATIC_INLINE void LL_LPTIM_ClearFlag_CC2(LPTIM_TypeDef *lptimx)
__STATIC_INLINE void LL_LPTIM_ClearFlag_CC1O(LPTIM_TypeDef *lptimx)
__STATIC_INLINE void LL_LPTIM_ClearFlag_CC2O(LPTIM_TypeDef *lptimx)
__STATIC_INLINE void LL_LPTIM_ClearFlag_ARRM(LPTIM_TypeDef *lptimx)
__STATIC_INLINE void LL_LPTIM_ClearFlag_EXTTRIG(LPTIM_TypeDef *lptimx)
__STATIC_INLINE void LL_LPTIM_ClearFlag_CMP1OK(LPTIM_TypeDef *lptimx)
__STATIC_INLINE void LL_LPTIM_ClearFlag_CMP2OK(LPTIM_TypeDef *lptimx)
__STATIC_INLINE void LL_LPTIM_ClearFlag_DIEROK(LPTIM_TypeDef *lptimx)
__STATIC_INLINE void LL_LPTIM_ClearFlag_ARROK(LPTIM_TypeDef *lptimx)
__STATIC_INLINE void LL_LPTIM_ClearFlag_UP(LPTIM_TypeDef *lptimx)
__STATIC_INLINE void LL_LPTIM_ClearFlag_DOWN(LPTIM_TypeDef *lptimx)
__STATIC_INLINE void LL_LPTIM_ClearFlag_REPOK(LPTIM_TypeDef *lptimx)
__STATIC_INLINE void LL_LPTIM_ClearFlag_UE(LPTIM_TypeDef *lptimx)

HAL LPTIM get flags

HAL1

HAL2

#define __HAL_LPTIM_GET_FLAG(__HANDLE__, __FLAG__)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CC1(const LPTIM_TypeDef *lptimx)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CC2(const LPTIM_TypeDef *lptimx)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CC1O(const LPTIM_TypeDef *lptimx)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CC2O(const LPTIM_TypeDef *lptimx)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_ARRM(const LPTIM_TypeDef *lptimx)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_EXTTRIG(const LPTIM_TypeDef *lptimx)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CMP1OK(const LPTIM_TypeDef *lptimx)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CMP2OK(const LPTIM_TypeDef *lptimx)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_DIEROK(const LPTIM_TypeDef *lptimx)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_ARROK(const LPTIM_TypeDef *lptimx)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_UP(const LPTIM_TypeDef *lptimx)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_DOWN(const LPTIM_TypeDef *lptimx)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_REPOK(const LPTIM_TypeDef *lptimx)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_UE(const LPTIM_TypeDef *lptimx)

HAL LPTIM get interruption source

HAL1

HAL2

#define __HAL_LPTIM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT(LPTIM_TypeDef *lptimx, uint32_t it_mask)

HAL LPTIM set repetition counter

HAL1

HAL2

#define __HAL_LPTIM_REPETITIONCOUNTER_SET(__HANDLE__ , __VALUE__)
__STATIC_INLINE void LL_LPTIM_SetRepetition(LPTIM_TypeDef *lptimx, uint32_t repetition)

HAL LPTIM get repetition counter

HAL1

HAL2

#define __HAL_LPTIM_REPETITIONCOUNTER_GET(__HANDLE__)
__STATIC_INLINE uint32_t LL_LPTIM_GetRepetition(const LPTIM_TypeDef *lptimx)

HAL LPTIM reset counter

HAL1

HAL2

#define __HAL_LPTIM_RESET_COUNTER(__HANDLE__)
__STATIC_INLINE void LL_LPTIM_ResetCounter(LPTIM_TypeDef *lptimx)

HAL LPTIM reset counter after read

HAL1

HAL2

#define __HAL_LPTIM_RESET_COUNTER_AFTERREAD(__HANDLE__)
__STATIC_INLINE void LL_LPTIM_EnableResetAfterRead(LPTIM_TypeDef *lptimx)

HAL LPTIM reset handle state

HAL1

HAL2

__HAL_LPTIM_RESET_HANDLE_STATE()

Removed : Use HAL_LPTIM_DeInit() instead when you need to reset all states


HAL LPTIM start continuous mode

HAL1

HAL2

__HAL_LPTIM_START_CONTINUOUS()

Removed : Use LL_LPTIM_StartCounter() with LL_LPTIM_OPERATING_MODE_CONTINUOUS as the operating mode instead.


HAL LPTIM start single mode

HAL1

HAL2

__HAL_LPTIM_START_SINGLE()

Removed : Use LL_LPTIM_StartCounter() with LL_LPTIM_OPERATING_MODE_ONESHOT as the operating mode instead.